package cn.xz.zysjz.adapter;


import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.Objects;

import cn.xz.zysjz.R;
import cn.xz.zysjz.bean.SJBean;
import cn.xz.zysjz.bean.UserBean;

/**
 * 商家列表适配器*/
public class SJJListAdapter extends BaseQuickAdapter<SJBean, BaseViewHolder> {

    public SJJListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, SJBean mData) {
        UserBean mListBean = mData.getUserBean();

        TextView tvName = helper.getView(R.id.tv_name);
        TextView tv_pass = helper.getView(R.id.tv_pass);
        TextView tv_xx = helper.getView(R.id.tv_xx);
        TextView tv_sm = helper.getView(R.id.tv_sm);
        tvName.setText(mListBean.getName());

        String ms = "未通过";
        if (mData.getGuo()){
            ms = "已通过";
        }
        tv_pass.setText(ms);

        String o = "-";
        if (mListBean.getOld() != null && !Objects.equals(mListBean.getOld(), "")){
            o = mListBean.getOld();
        }

        String s = "-";
        if (mListBean.getSex() != null && !Objects.equals(mListBean.getSex(), "")){
            s = mListBean.getOld();
        }
        tv_xx.setText("年龄: " + o + ",性别: " + s);

        tv_sm.setText(mData.getMas());
    }
}
